import request from "../utils/request";

//获取商品列表
export function getOrderList(data) {
  return request({
    method: "post",
    url: "/api/PCApplet/OrderList_Admin",
    data
  });
}

//开关状态
export function updateCheckStatus(params) {
  return request({
    method: "get",
    url: "/api/PCApplet/UpdateCheckName_Admin",
    params
  });
}

// 上传图片
export function UploadLargeFile(data) {
  return request({
    method: "post",
    url: "/api/PCApplet/UploadLargeFile",
    data
  });
}

// 上传图片（原发送消息）
export function sendMessageOk(data) {
  return request({
    method: "post",
    url: "/api/PCApplet/InsertMsg_Admin",
    data
  });
}

// 设置图片的显隐（图片列表）
export function setMsg(data) {
  return request({
    method: "put",
    url: "/api/PCApplet/SetMsg_Admin",
    data
  });
}

// 发送消息
export function sendMessageList(params) {
  return request({
    method: "get",
    url: "/api/PCApplet/ListMsg_Admin",
    params
  });
}

//修改订单详情
export function updateOrderDetail(data) {
  return request({
    method: "post",
    url: "/api/PCApplet/UpdateOrders_Admin",
    data
  });
}

//删除单条聊天记录
export function deleteMessageById(id) {
  return request({
    method: "get",
    url: `/api/PCApplet/DelteMsg_Admin?id=${id}`
  });
}

//计算月结订单
export const getMonthlySet = params => {
  return request({
    method: "get",
    url: "/api/PCApplet/MonthlySet",
    params
  });
};

//月结订单设置结清状态
export const setOrderPayOff = params => {
  return request({
    method: "get",
    url: "/api/PCApplet/SetOrderPayOff",
    params
  });
};

//获取产地
export const getProductArea = params => {
  return request({
    method: "get",
    url: "/api/producer/List",
    params
  });
};

//修改测评人员
export function updateCheckName(data) {
  return request({
    method: "post",
    url: "/api/PCApplet/NewUpdateCheckName_Admin",
    data
  });
}

//审核
export function UpdateCheckApprove(data) {
  return request({
    method: "post",
    url: "/api/PCApplet/UpdateCheckApprove",
    data
  });
}

//退款
export function OrderRefund(params) {
  return request({
    method: "put",
    url: "/api/PCApplet/OrderRefund",
    params
  });
}

//图片拖拽
export function updateImgList(data) {
  return request({
    method: "put",
    url: "/api/PCApplet/ListMsg_Update",
    data
  });
}

//订单详情
export const GetOrderDetail = params => {
  return request({
    method: "get",
    url: "/api/Orders/GetOrderDetail",
    params
  });
};
